import React, { Component } from "react";

import "./VideoListTopButton.css";

import config from '../config.js'

var one=10;

class VideoListTopButton extends Component {
  state = {
    fileList:{length:0}
  };
  render() {
    one=this;

    return (
      <div className="input-wrap">
        <div className="btn outer-btn upload-input">
          上传<input
            type="file"
            multiple
            onChange={this.props.selectFiles.bind(this)}
            className={"outer-file"}
          />
        </div>
        {/* <div className="upload-input" onClick={()=>this.uploadfile()}>上传</div> */}
        <button className="logout-input" onClick={() => this.logOut()}>退出</button>
      </div>
    );
  }
 



  logOut(){
    console.log("logout")

    var that=this;
    var info=config.getInfo();

    var arg={
        uid:info.uid,
        token:info.token
    }

    config.sendRequest(config.url.logout,arg,function(res){
        sessionStorage.clear();
        //返回
        that.props.history.push("/")
    })
}
}

export default VideoListTopButton;
